package com.twu.biblioteca.Models;

/**
 * Created with IntelliJ IDEA.
 * User: spacetime
 * Date: 16/8/13
 * Time: 2:54 AM
 */
public class Movie {

    private String name;
    private int year;
    private String director;
    private float rating;

    public Movie(String name, int year, String director, float rating) {
        this.name = name;
        this.year = year;
        this.director = director;
        this.rating = rating;
    }

    public String getName() {
        return name;
    }

    public int getYear() {
        return year;
    }

    public String getDirector() {
        return director;
    }

    public float getRating() {
        return rating;
    }

    public String getMovieString() {
        // New releases will have rating as 0.0
        return (this.getName() + "\t" + this.getYear() + "\t" + this.getDirector() + "\t" +
                ((this.getRating() == 0.0) ? "N/A" : this.getRating()));
    }

    public static String getMovieHeaderString() {
        return ("Movie\tYear\tDirector\tRating");
    }
}
